<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

    <title th:text="#{cas.login.pagetitle}">Passwordless Get User Id View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
</head>

<body>
    <main class="container mt-3 mb-3">
        <div layout:fragment="content" id="login" class="d-flex justify-content-center">
            <div class="mdc-card card mdc-card-content w-lg-50 p-4">
                <div th:replace="~{fragments/serviceui :: serviceUI}">
                    <a href="fragments/serviceui.html">service ui fragment</a>
                </div>

                <h3 th:text="#{passwordless.getuser.header}">Passwordless Authentication</h3>
                <p th:text="#{passwordless.getuser.description}"></p>

                <form method="post" id="fm1" class="d-block" th:action="@{/login}">

                    <div class="banner banner-danger alert alert-danger" th:if="${flowRequestContext.messageContext.hasErrorMessages()}">
                        <span th:each="message : ${flowRequestContext.messageContext.allMessages}" th:utext="${message.text}">Message Text</span>
                    </div>

                    <div class="cas-field form-group my-3">
                        <div class="w-100">
                            <label for="username"
                                   class="mdc-text-field mdc-text-field--outlined control-label">
                                <span class="mdc-notched-outline">
                                    <span class="mdc-notched-outline__leading"></span>
                                    <span class="mdc-notched-outline__notch">
                                        <span class="mdc-floating-label" th:utext="#{screen.welcome.label.netid}">Token</span>
                                    </span>
                                    <span class="mdc-notched-outline__trailing"></span>
                                </span>
                                <input class="mdc-text-field__input form-control"
                                       type="text"
                                       name="username"
                                       id="username"
                                       size="25"
                                       th:accesskey="#{screen.welcome.label.netid.accesskey}"
                                       autocapitalize="none"
                                       spellcheck="false"
                                       autocomplete="username" required />
                            </label>
                        </div>
                    </div>

                    <span th:if="${passwordlessCaptchaEnabled}">
                        <div th:replace="~{fragments/recaptcha :: recaptchaToken}" />
                    </span>
                    
                    <div th:replace="~{fragments/submitbutton :: submitButton (messageKey='screen.welcome.button.login')}"/>

                    <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
                    <input type="hidden" name="_eventId" value="submit" />
                </form>
            </div>
        </div>
    </main>
</body>

</html>
